// 时间转化
export const getDiffTime = (s1, s2) => {
    s1 = new Date(s1.replace(/-/g, "/"));
    s2 = new Date(s2.replace(/-/g, "/"));
    let a = s1.getTime() - s2.getTime();
    let ms = Math.abs(s1.getTime() - s2.getTime());
    ms = ms / 1000 / 60 / 60;
    ms = a > 0 ? -ms : ms;
    return ms;
};
export const formatDate = (time) => {
    var date = new Date(time);
    var YY = date.getFullYear() + "-";
    var MM =
        (date.getMonth() + 1 < 10 ?
            "0" + (date.getMonth() + 1) :
            date.getMonth() + 1) + "-";
    var DD = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
    var hh =
        (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
    var mm =
        (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) +
        ":";
    var ss = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
    return YY + MM + DD + " " + hh + mm + ss;
};
// 商品过滤
export const fliterKind = (kindId) => {
    switch (kindId) {
        case 1:
            return "一乡一品";
            break;
        case 2:
            return "秒杀区";
            break;
        case 3:
            return "易货区";
            break;
        case 4:
            return "积分区";
            break;
        case 5:
            return "体验区";
            break;
    }
};